#pragma once
#include "IEffectUnit.h"
#include "WarePrepare.h"

BEGIN_WARE

class ITexture;
class IEffectUnitProp;
class IResourceManager;

class CEffectUnit : public IEffectUnit
{
public:

	CEffectUnit( IEffectUnitProp* pEffectUnitProp );
	~CEffectUnit();

	typedef map< float32, ITexture* >  TextureMap;

	virtual VBOOL				Create( IResourceManager* pResMgr );

	virtual IEffectUnitProp*	GetEffectUnitProp();

	virtual	void				SetEffectUnitProp( IEffectUnitProp* pProp );

	void						SetStartTime( uint32 uStartTime )	{ m_uStartTime = uStartTime; }

	int32						GetType();
	void						CreateTexture();
	void						ReleaseAllTexture();
	
protected:

	IResourceManager*			m_pResMgr;
	IEffectUnitProp*			m_pEffectUnitProp;
	TextureMap					m_mapTexture;

	uint32						m_uStartTime;
	int32						m_nEffectUnitType;
};

END_WARE